<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
<form name="searchform" action="?m=courses&c=admin_courses&a=bind_list&menuid=<?php echo $_GET['menuid'];?>" method="post" >
<table width="100%" cellspacing="0" class="search-form">
	<tbody>
		<tr>
			<td>
				<div class="explain-col">
					模型选择：
					<?php echo form::select($member_models, $search_modelid, 'name="search_modelid"');?>
					课时选择：
					<?php echo form::select($ct_list, $search_ctid, 'name="search_ctid"', L('selected'));?>
					审核状态：
					<?php echo form::select($check_list, $search_check, 'name="search_check"', L('selected'));?>
					<input type="submit" value="<?php echo L('search')?>" class="button" name="srch_submit">
				</div>
			</td>
		</tr>
	</tbody>
</table>
</form>

<form name="myform" action="?m=courses&c=admin_courses&a=bind_list" method="post">
<div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
	            <th width="35" align="center">
	            	<input type="checkbox" value="" id="check_box" onclick="selectall('bind_ids[]');">
	            </th>
				<th width="68" align="center">班级  课程</th>
				<th width="80" align="center">会员姓名</th>
				<th width='120' align="center">申请时间</th>
				<th align="center">申请通过?</th>
				<th width="80" align="center"><?php echo L('operations_manage')?></th>
            </tr>
        </thead>
    <tbody>
 <?php 
if(is_array($data)){
	foreach($data as $bind){
?>   
	<tr>
		<td align="center" width="35">
			<?php if (!$bind['is_allow']){?>
				<input type="checkbox" name="bind_ids[]" value="<?php echo $bind['bind_id']?>">
			<?php }?>
		</td>
		<td align="center"><?php echo $bind['ct_name']?></td>
		<td align="center"><?php echo $bind['user_name']?></td>
		<td align="center"><?php echo $bind['apply_time']?></td>
		<td align="center">
			<?php if ($bind['is_allow']){?>
				<span style="color:#093">通过</span>
			<?php }else{?>
				<span style="color:#CCC">待审核</span>
			<?php }?>
		</td>
		<td align="center">&nbsp;
		<?php if (!$bind['is_allow']){?>
			<a href='?m=courses&c=admin_courses&a=bind_list&dt=agree&bid=<?php echo $bind['bind_id']?>&search_modelid=<?php echo $search_modelid?>'
				style="color:#093;">同意</a> | 
			<a href='?m=courses&c=admin_courses&a=bind_list&dt=refuse&bid=<?php echo $bind['bind_id']?>&search_modelid=<?php echo $search_modelid?>'
				onClick="return confirm('拒绝该课程绑定将删除该申请记录，您确定继续吗？')" style="color:#E30;">拒绝</a>
		<?php }else{?>
		  <a href='?m=courses&c=admin_courses&a=bind_list&dt=delete&bid=<?php echo $bind['bind_id']?>&search_modelid=<?php echo $search_modelid?>'
				onClick="return confirm('删除该课程绑定将取消该会员的学习资格，您确定继续吗？')"><?php echo L('delete')?></a>
		<?php }?>
		</td>
	</tr>
<?php 
	}
}
?>
</tbody>
</table>
	<div class="btn">
		<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)">
			<?php echo L('selected_all')?>
		</a>
		 / 
		<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)">
			<?php echo L('cancel')?>
		</a>
		&nbsp;&nbsp;&nbsp;&nbsp;
		选择操作：
		<input name='op_value' type="radio" value="1" checked > 同意
		<input name='op_value' type="radio" value="0" > 拒绝 &nbsp;&nbsp;&nbsp;&nbsp;
		
		<input name="search_modelid" type="hidden" value="<?php echo $search_modelid?>">
		<input name="submit" type="submit" class="button" value="提交操作"
			onClick="return confirm('确定批量操作吗？')">
	</div>  
	<div id="pages"><?php echo $this->db->pages;?></div>
</div>
</form>
</div>
</body>
</html>